def copy_file(filename):
    filename=filename.split('/')[-1]
    file_init = open(filename, 'rb')
    file_fuben = open('/home/tarena/' + filename, 'wb')
    while True:
        context = file_init.read(1024)
        if not context:
            break
        else:
            file_fuben.write(context)
    file_init.close()
    file_fuben.close()


copy_file('file.txt')
